import axios from 'axios';
import http from './http';

// 发送验证码
export const sendSmsCode = async (phoneNumber) => {
  try {
    const response = await http.post('/api/send-sms-code', {
      phoneNumber
    });
    return response.data;
  } catch (error) {
    console.error('发送验证码失败:', error);
    throw error;
  }
};

// 验证短信验证码
export const verifySmsCode = async (phoneNumber, code) => {
  try {
    const response = await http.post('/api/verify-sms-code', {
      phoneNumber,
      code
    });
    return response.data;
  } catch (error) {
    console.error('验证码验证失败:', error);
    throw error;
  }
}; 